package nihe;
public class QuXian
{
	int j;
	double a,b,c,d;
	double a1=0,a2=0,a3=0,b1=0,b2=0,b3=0,c1=0,c2=0,c3=0,d1=0,d2=0,d3=0;
	double db1[]=new double[ShuRu.i];
	double db2[]=new double[ShuRu.i];
	double db3[]=new double[ShuRu.i];
	public QuXian()
	{
		for(j=0;j<ShuRu.i;j++)
		{
			db1[j]=ShuRu.db1[j];
			db2[j]=ShuRu.db2[j];
		}


		for(j=0;j<db1.length;j++)
		{
			a1=a1+db1[j]*db1[j]*db1[j]*db1[j];
			a2=a2+db1[j]*db1[j]*db1[j];
			a3=a3+db1[j]*db1[j];
			b1=a2;
			b2=a3;
			b3=b3+db1[j];
			c1=b2;
			c2=b3;
			c3=db1.length;
			d1=d1+(-(db1[j]*db1[j]*db2[j]));
			d2=d2+(-(db1[j]*db2[j]));
			d3=d3+(-db2[j]);
		}

		d=a1*b2*c3+b1*c2*a3+c1*a2*b3-c1*b2*a3-a1*c2*b3-b1*a2*c3;
		a=-(b1*c2*d3+c1*d2*b3+d1*b2*c3-d1*c2*b3-b1*d2*c3-c1*b2*d3)/d;
		b=(a1*c2*d3+c1*d2*a3+d1*a2*c3-d1*c2*a3-a1*d2*c3-c1*a2*d3)/d;
		c=-(a1*b2*d3+b1*d2*a3+d1*a2*b3-d1*b2*a3-a1*d2*b3-b1*a2*d3)/d;

		for(j=0;j<db3.length;j++)
		{
			db3[j]=a*db1[j]*db1[j]+b*db1[j]+c;
		}
	}
}